package cn.hznc.domain.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import io.swagger.models.auth.In;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 刀具信息表(自动创建表无法生产json格式)
 *
 * @author xiahuanyu
 * @date 2023/3/3
 */
@Getter
@Setter
@Table(name = "t_tool_fork_info")
@TableName(value = "t_tool_fork_info")
public class ToolForkInfoEntity {

    /**
     * 系统id
     */
    @Column(name = "id",type = MySqlTypeConstant.INT,length = 11,isKey = true,isAutoIncrement = true)
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 工具类型
     */
    @Column(name = "type",type = MySqlTypeConstant.VARCHAR, length = 200)
    @TableField("type")
    private String type;

    /**
     * 工具类型编号
     */
    @Column(name = "tool_no",type = MySqlTypeConstant.VARCHAR, length = 40)
    @TableField("tool_no")
    private String toolNo;

    /**
     * 品牌
     */
    @Column(name = "brand",type = MySqlTypeConstant.VARCHAR, length = 200)
    @TableField("brand")
    private String brand;

    /**
     * 刀具编码idnr
     */
    @Column(name = "idnr",type = MySqlTypeConstant.VARCHAR, length = 100)
    @TableField("idnr")
    private String idnr;

    /**
     * Cutting diameter
     * 切削直径(dc)
     */
    @Column(name = "dc",type = MySqlTypeConstant.DECIMAL,length=10)
    @TableField("dc")
    private BigDecimal dc;

    /**
     * GRDMFG(牌号)
     */
    @Column(name = "grdmfg",type = MySqlTypeConstant.VARCHAR, length = 100)
    @TableField("grdmfg")
    private String grdmfg;

    /**
     * 物料编码
     */
    @Column(name = "partno",type = MySqlTypeConstant.VARCHAR, length = 100)
    @TableField("partno")
    private String partno;

    /**
     * 物料型号
     */
    @Column(name = "part_type",type = MySqlTypeConstant.VARCHAR, length = 100)
    @TableField("part_type")
    private String partType;

    /**
     * 总长度
     */
    @Column(name = "oal",type = MySqlTypeConstant.DECIMAL,length=10,decimalLength = 0)
    @TableField("oal")
    private BigDecimal oal;

    /**
     * 手性方向
     * -left/-right
     */
    @Column(name = "hand",type = MySqlTypeConstant.VARCHAR,length = 10)
    @TableField("hand")
    private String hand;

    /**
     * 程序指令码
     */
    @Column(name = "ccws",type = MySqlTypeConstant.VARCHAR,length = 200)
    @TableField("ccws")
    private String ccws;

    /**
     * 刀片长度
     */
    @Column(name = "insl",type = MySqlTypeConstant.DECIMAL,length=10,decimalLength = 0)
    @TableField("insl")
    private BigDecimal insl;

    /**
     * 描述
     */
    @Column(name = "description",type = MySqlTypeConstant.VARCHAR,length = 200)
    @TableField("description")
    private String description;

    /**
     * 二维模型
     */
    @Column(name = "two_dimensional_model", type = MySqlTypeConstant.VARCHAR , length = 255)
    @TableField("two_dimensional_model")
    private String twoDimensionalModel;

    /**
     * 三维模型
     */
    @Column(name = "three_dimensional_model", type = MySqlTypeConstant.VARCHAR , length = 255)
    @TableField("three_dimensional_model")
    private String threeDimensionalModel;

    /**
     * 三维模型stl
     */
    @Column(name = "three_dimensional_model_stl", type = MySqlTypeConstant.VARCHAR , length = 255)
    @TableField("three_dimensional_model_stl")
    private String threeDimensionalModelStl;

    /**
     * 图片
     */
    @Column(name = "image",type = MySqlTypeConstant.VARCHAR , length = 255)
    @TableField("image")
    private String image;

    /**
     * 创建时间
     */
    @Column(name = "create_time",type = MySqlTypeConstant.DATETIME,length = 0)
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("create_time")
    private Date createTime;

    /**
     * 其它详细参数
     */
    @Column(name = "parameters",type = MySqlTypeConstant.TEXT)
    @TableField("parameters")
    private String parameters;


    /**
     * 刀片安装代码
     */
    @Column(name = "iic",type = MySqlTypeConstant.VARCHAR,length = 50)
    @TableField("iic")
    private String iic;


    /**
     * 工作长度
     */
    @Column(name = "lf",type = MySqlTypeConstant.VARCHAR,length = 40)
    @TableField("lf")
    private String lf;


    /**
     * 主偏角
     */
    @Column(name = "kapr",type = MySqlTypeConstant.VARCHAR,length = 40)
    @TableField("kapr")
    private String kapr;


    /**
     * 刀盘安装刀片数量
     */
    @Column(name = "z",type = MySqlTypeConstant.VARCHAR,length = 40)
    @TableField("z")
    private String z;


    /**
     * 产品系类
     */
    @Column(name = "proddes",type = MySqlTypeConstant.VARCHAR,length = 255)
    @TableField("proddes")
    private String proddes;

    /**
     * 产品系类
     */
    @Column(name = "lpr",type = MySqlTypeConstant.VARCHAR,length = 255)
    @TableField("lpr")
    private String lpr;

    /**
     * 产品系类
     */
    @Column(name = "dcon_ws",type = MySqlTypeConstant.VARCHAR,length = 255)
    @TableField("dcon_ws")
    private String dcon_ws;

    /**
     *
     */
    @Column(name = "ccms",type = MySqlTypeConstant.VARCHAR,length = 100)
    @TableField("ccms")
    private String ccms;

    /**
     *
     */
    @Column(name = "bd",type = MySqlTypeConstant.VARCHAR,length = 100)
    @TableField("bd")
    private String bd;

    /**
     *
     */
    @Column(name = "dcon",type = MySqlTypeConstant.VARCHAR,length = 100)
    @TableField("dcon")
    private String dcon;

    /**
     *
     */
    @Column(name = "dmin",type = MySqlTypeConstant.VARCHAR,length = 100)
    @TableField("dmin")
    private String dmin;


    /**
     *
     */
    @Column(name = "crclmfg",type = MySqlTypeConstant.VARCHAR,length = 100)
    @TableField("crclmfg")
    private String crclmfg;

    /**
     *
     */
    @Column(name = "lu",type = MySqlTypeConstant.VARCHAR,length = 100)
    @TableField("lu")
    private String lu;

    /**
     *
     */
    @Column(name = "original_params",type = MySqlTypeConstant.LONGTEXT)
    @TableField("original_params")
    private String originalParams;

    /**
     * 所属类目
     */
    @TableField(exist = false)
    private Integer qryIndex;

    /**
     * 所属类目
     */
    @TableField(exist = false)
    private Integer sign;

    /**
     * 所属类目
     */
    @TableField(exist = false)
    private BigDecimal toolLife;

    /**
     * 价格
     */
    @Column(name = "price",type = MySqlTypeConstant.DOUBLE,length = 2)
    @TableField("price")
    private Double price;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ToolForkInfoEntity that = (ToolForkInfoEntity) o;

        return partno.equals(that.partno);
    }

    @Override
    public int hashCode() {
        return partno.hashCode();
    }
}
